package junit;
/**
 * Description : 
 * @Author Evan Liu
 * @Date 2018年12月7日
 */

import java.util.ArrayList;
import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.test.context.ActiveProfiles;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.vip.zuul.ZuulApplication;
import com.vip.zuul.utils.ApplicationUtils;
import com.vip.zuul.utils.RedisUtils;
import com.vip.zuul.vo.RouteDTO;

@ActiveProfiles("development")
@RunWith(SpringJUnit4ClassRunner.class)
@SpringBootTest(classes=ZuulApplication.class)// 指定spring-boot的启动类 
public class RedisJunit {
	
	@Test
	public void redisTest() {
		String key = "name";
		String value = "liuwei";
		
		RedisTemplate<String, Object> redisTemplate = ApplicationUtils.getBean(RedisTemplate.class);
		redisTemplate.opsForValue().set(key, value);
		
		System.out.println(redisTemplate.opsForValue().get(key));
		
		System.out.println(RedisUtils.get(key));
		
		RouteDTO dto = new RouteDTO();
		dto.setBalancerName(value);
		
	}
}


